home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / drivers / polepos.c < prev    next >
C/C++ Source or Header  |  2000-05-04  |  49KB  |  1,103 lines

  1. /***************************************************************************
  2.   Pole Position memory map (preliminary)
  3.  
  4. driver by Ernesto Corvi, Juergen Buchmueller, Alex Pasadyn, Aaron Giles
  5.  
  6.  
  7. Z80
  8. ----------------------------------------
  9. 0000-2fff (R) ROM
  10. 3000-37ff (R/W) Battery Backup RAM
  11. 4000-43ff (R/W) Motion Object memory
  12.     (4380-43ff Vertical and Horizontal position)
  13. 4400-47ff (R/W) Motion Object memory
  14.     (4780-47ff Vertical and Horizontal position)
  15. 4800-4bff (R/W) Road Memory
  16.     (4800-49ff Character)
  17.     (4b80-4bff Horizontal Scroll)
  18. 4c00-57ff (R/W) Alphanumeric Memory
  19.     (4c00-4fff) Alphanumeric
  20.     (5000-53ff) View character
  21. 8000-83ff (R/W) Sound Memory
  22.     (83c0-83ff Sound)
  23. 9000-90ff (R/W) 4 bit CPU data
  24. 9100-9100 (R/W) 4 bit CPU controller
  25. a000-a000 (R/W) Input/Output
  26.           on WRITE: IRQ Enable ( 1 = enable, 0 = disable )
  27.           on READ: bit0 = Not Used, bit1 = 128V, bit2 = Power-Line Sense, bit3 = ADC End Flag
  28. a001-a001 (W) 4 bit CPU Enable
  29. a002-a002 (W) Sound enable
  30. a003-a003 (W) ADC Input Select
  31. a004-a004 (W) CPU 1 Enable
  32. a005-a005 (W) CPU 2 Enable
  33. a006-a006 (W) Start Switch
  34. a007-a007 (W) Color Enable
  35. a100-a100 (W) Watchdog reset
  36. a200-a200 (W) Car Sound ( Lower Nibble )
  37. a300-a300 (W) Car Sound ( Upper Nibble )
  38.  
  39. Z8002 #1 & #2 (they share the ram)
  40. ----------------------------------------
  41. 0000-3fff ROM
  42. 6000-6003 NMI-Enable
  43.     (6000-6001 CPU1 NMI enable)
  44.     (6002-6003 CPU2 NMI enable)
  45. 8000-8fff Motion Object Memory
  46.     (8700-87ff Horizontal and Vertical position)
  47.     (8f00-8fff Character, Color, Vertical size, Horizontal size)
  48. 9000-97ff Road Memory
  49.     (9000-93ff Character)
  50.     (9700-97ff Horizontal scroll)
  51. 9800-9fff Alphanumeric Memory (video RAM #1)
  52. a000-afff View character memory (I think it refers to 'View' as the background)
  53. c000-c000 View horizontal position
  54. c100-c100 Road vertical position
  55.  
  56. NOTES:
  57. - Pole Position II reports 'Manual Start' on the Test Mode. This is ok,
  58. because they had to accomodate the hardware from Pole Position I to allow
  59. track selection.
  60.  
  61. ***************************************************************************/
  62.  
  63. #include "driver.h"
  64. #include "cpu/z8000/z8000.h"
  65. #include "vidhrdw/generic.h"
  66.  
  67.  
  68. /* from machine */
  69. void polepos_init_machine(void);
  70. WRITE_HANDLER( polepos_z80_irq_enable_w );
  71. WRITE_HANDLER( polepos_z8002_nvi_enable_w );
  72. int polepos_z8002_1_interrupt(void);
  73. int polepos_z8002_2_interrupt(void);
  74. WRITE_HANDLER( polepos_z8002_enable_w );
  75. WRITE_HANDLER( polepos_adc_select_w );
  76. READ_HANDLER( polepos_adc_r );
  77. READ_HANDLER( polepos_io_r );
  78. WRITE_HANDLER( polepos_mcu_enable_w );
  79. READ_HANDLER( polepos_mcu_control_r );
  80. WRITE_HANDLER( polepos_mcu_control_w );
  81. READ_HANDLER( polepos_mcu_data_r );
  82. WRITE_HANDLER( polepos_mcu_data_w );
  83. WRITE_HANDLER( polepos_start_w );
  84. READ_HANDLER( polepos2_ic25_r );
  85.  
  86. /* from sndhrdw */
  87. int polepos_sh_start(const struct MachineSound *msound);
  88. void polepos_sh_stop(void);
  89. void polepos_sh_update(void);
  90. WRITE_HANDLER( polepos_engine_sound_lsb_w );
  91. WRITE_HANDLER( polepos_engine_sound_msb_w );
  92.  
  93. /* from vidhrdw */
  94. extern UINT8 *polepos_view_memory;
  95. extern UINT8 *polepos_road_memory;
  96. extern UINT8 *polepos_alpha_memory;
  97. extern UINT8 *polepos_sprite_memory;
  98.  
  99. int polepos_vh_start(void);
  100. void polepos_vh_stop(void);
  101. void polepos_vh_convert_color_prom(unsigned char *palette, unsigned short *colortable,const unsigned char *color_prom);
  102. void polepos_vh_screenrefresh(struct osd_bitmap *bitmap,int full_refresh);
  103.  
  104. WRITE_HANDLER( polepos_view_w );
  105. WRITE_HANDLER( polepos_road_w );
  106. WRITE_HANDLER( polepos_alpha_w );
  107. WRITE_HANDLER( polepos_sprite_w );
  108. WRITE_HANDLER( polepos_z80_view_w );
  109. WRITE_HANDLER( polepos_z80_road_w );
  110. WRITE_HANDLER( polepos_z80_alpha_w );
  111. WRITE_HANDLER( polepos_z80_sprite_w );
  112.  
  113. READ_HANDLER( polepos_view_r );
  114. READ_HANDLER( polepos_road_r );
  115. READ_HANDLER( polepos_alpha_r );
  116. READ_HANDLER( polepos_sprite_r );
  117. READ_HANDLER( polepos_z80_view_r );
  118. READ_HANDLER( polepos_z80_road_r );
  119. READ_HANDLER( polepos_z80_alpha_r );
  120. READ_HANDLER( polepos_z80_sprite_r );
  121.  
  122. WRITE_HANDLER( polepos_view_hscroll_w );
  123. WRITE_HANDLER( polepos_road_vscroll_w );
  124.  
  125.  
  126.  
  127. static unsigned char *nvram;
  128. static size_t nvram_size;
  129.  
  130. static void nvram_handler(void *file, int read_or_write)
  131. {
  132.     if (read_or_write)
  133.         osd_fwrite(file,nvram,nvram_size);
  134.     else
  135.     {
  136.         if (file)
  137.             osd_fread(file,nvram,nvram_size);
  138.         else
  139.             memset(nvram,0xff,nvram_size);
  140.     }
  141. }
  142.  
  143.  
  144. /*********************************************************************
  145.  * CPU memory structures
  146.  *********************************************************************/
  147.  
  148. static struct MemoryReadAddress z80_readmem[] =
  149. {
  150.     { 0x0000, 0x2fff, MRA_ROM },                /* ROM */
  151.     { 0x3000, 0x37ff, MRA_RAM },                /* Battery Backup */
  152.     { 0x4000, 0x47ff, polepos_z80_sprite_r },    /* Motion Object */
  153.     { 0x4800, 0x4bff, polepos_z80_road_r },        /* Road Memory */
  154.     { 0x4c00, 0x4fff, polepos_z80_alpha_r },    /* Alphanumeric (char ram) */
  155.     { 0x5000, 0x57ff, polepos_z80_view_r },     /* Background Memory */
  156.     { 0x8000, 0x83ff, MRA_RAM },                 /* Sound Memory */
  157.     { 0x9000, 0x90ff, polepos_mcu_data_r },        /* 4 bit CPU data */
  158.     { 0x9100, 0x9100, polepos_mcu_control_r },    /* 4 bit CPU control */
  159.     { 0xa000, 0xa000, polepos_io_r },            /* IO */
  160.     { -1 }                                         /* end of table */
  161. };
  162.  
  163. static struct MemoryWriteAddress z80_writemem[] =
  164. {
  165.     { 0x0000, 0x2fff, MWA_ROM },                         /* ROM */
  166.     { 0x3000, 0x37ff, MWA_RAM, &nvram, &nvram_size },    /* Battery Backup */
  167.     { 0x4000, 0x47ff, polepos_z80_sprite_w },            /* Motion Object */
  168.     { 0x4800, 0x4bff, polepos_z80_road_w },             /* Road Memory */
  169.     { 0x4c00, 0x4fff, polepos_z80_alpha_w },             /* Alphanumeric (char ram) */
  170.     { 0x5000, 0x57ff, polepos_z80_view_w },             /* Background Memory */
  171.     { 0x8000, 0x83bf, MWA_RAM },                         /* Sound Memory */
  172.     { 0x83c0, 0x83ff, polepos_sound_w, &polepos_soundregs },/* Sound data */
  173.     { 0x9000, 0x90ff, polepos_mcu_data_w },                /* 4 bit CPU data */
  174.     { 0x9100, 0x9100, polepos_mcu_control_w },             /* 4 bit CPU control */
  175.     { 0xa000, 0xa000, polepos_z80_irq_enable_w },        /* NMI enable */
  176.     { 0xa001, 0xa001, polepos_mcu_enable_w },            /* 4 bit CPU enable */
  177.     { 0xa002, 0xa002, MWA_NOP },                         /* Sound Enable */
  178.     { 0xa003, 0xa003, polepos_adc_select_w },            /* ADC Input select */
  179.     { 0xa004, 0xa005, polepos_z8002_enable_w },            /* CPU 1/2 enable */
  180.     { 0xa006, 0xa006, polepos_start_w },                /* Start Switch */
  181.     { 0xa007, 0xa007, MWA_NOP },                         /* Color Enable */
  182.     { 0xa100, 0xa100, watchdog_reset_w },                 /* Watchdog */
  183.     { 0xa200, 0xa200, polepos_engine_sound_lsb_w },        /* Car Sound ( Lower Nibble ) */
  184.     { 0xa300, 0xa300, polepos_engine_sound_msb_w },     /* Car Sound ( Upper Nibble ) */
  185.     { -1 }                                                 /* end of table */
  186. };
  187.  
  188. static struct IOReadPort z80_readport[] =
  189. {
  190.     { 0x00, 0x00, polepos_adc_r },
  191.     { -1 }    /* end of table */
  192. };
  193.  
  194. static struct IOWritePort z80_writeport[] =
  195. {
  196.     { 0x00, 0x00, IOWP_NOP }, /* ??? */
  197.     { -1 }    /* end of table */
  198. };
  199.  
  200. static struct MemoryReadAddress z8002_readmem[] =
  201. {
  202.     { 0x0000, 0x7fff, MRA_ROM },            /* ROM */
  203.     { 0x8000, 0x8fff, polepos_sprite_r },    /* Motion Object */
  204.     { 0x9000, 0x97ff, polepos_road_r },        /* Road Memory */
  205.     { 0x9800, 0x9fff, polepos_alpha_r },     /* Alphanumeric (char ram) */
  206.     { 0xa000, 0xafff, polepos_view_r },        /* Background memory */
  207.     { -1 }                                     /* end of table */
  208. };
  209.  
  210. static struct MemoryWriteAddress z8002_writemem[] =
  211. {
  212.     { 0x6000, 0x6003, polepos_z8002_nvi_enable_w },                    /* NVI enable */
  213.     { 0x0000, 0x7fff, MWA_ROM },                                    /* ROM */
  214.     { 0x8000, 0x8fff, polepos_sprite_w, &polepos_sprite_memory },    /* Motion Object */
  215.     { 0x9000, 0x97ff, polepos_road_w, &polepos_road_memory },        /* Road Memory */
  216.     { 0x9800, 0x9fff, polepos_alpha_w, &polepos_alpha_memory },          /* Alphanumeric (char ram) */
  217.     { 0xa000, 0xafff, polepos_view_w, &polepos_view_memory },        /* Background memory */
  218.     { 0xc000, 0xc001, polepos_view_hscroll_w },                        /* Background horz scroll position */
  219.     { 0xc100, 0xc101, polepos_road_vscroll_w },                        /* Road vertical position */
  220.     { -1 }                                                              /* end of table */
  221. };
  222.  
  223.  
  224. /*********************************************************************
  225.  * Input port definitions
  226.  *********************************************************************/
  227.  
  228. INPUT_PORTS_START( polepos )
  229.     PORT_START  /* IN0 - Mostly Fake - Handled by the MCU */
  230.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
  231.     PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_TOGGLE, "Gear Change", KEYCODE_SPACE, IP_JOY_DEFAULT ) /* Gear */
  232.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  233.     PORT_DIPNAME( 0x08, 0x08, "Display Shift" )
  234.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  235.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  236.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
  237.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
  238.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED )
  239.     PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  240.  
  241.     PORT_START  /* DSW0 */
  242.     PORT_DIPNAME( 0x01, 0x01, "Nr. of Laps" )
  243.     PORT_DIPSETTING(    0x00, "3" )
  244.     PORT_DIPSETTING(    0x01, "4" )
  245.     PORT_DIPNAME( 0x06, 0x06, "Game Time" )
  246.     PORT_DIPSETTING(    0x00, "90 secs." )
  247.     PORT_DIPSETTING(    0x04, "100 secs." )
  248.     PORT_DIPSETTING(    0x02, "110 secs." )
  249.     PORT_DIPSETTING(    0x06, "120 secs." )
  250.     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_B ) )
  251.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  252.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_2C ) )
  253.     PORT_DIPSETTING(    0x18, DEF_STR( 4C_3C ) )
  254.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  255.     PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coin_A ) )
  256.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
  257.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
  258.     PORT_DIPSETTING(    0xa0, DEF_STR( 3C_2C ) )
  259.     PORT_DIPSETTING(    0x60, DEF_STR( 4C_3C ) )
  260.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  261.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  262.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
  263.     PORT_DIPSETTING(    0xe0, DEF_STR( Free_Play ) )
  264.  
  265.     PORT_START  /* DSW1 */
  266.     PORT_DIPNAME( 0x01, 0x01, DEF_STR( Demo_Sounds ) )
  267.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  268.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  269.     PORT_DIPNAME( 0x02, 0x02, "Speed Unit" )
  270.     PORT_DIPSETTING(    0x02, "MPH" )
  271.     PORT_DIPSETTING(    0x00, "KPH" )
  272.     PORT_DIPNAME( 0x1c, 0x08, "Extended Rank" )
  273.     PORT_DIPSETTING(    0x00, "A" )
  274.     PORT_DIPSETTING(    0x10, "B" )
  275.     PORT_DIPSETTING(    0x08, "C" )
  276.     PORT_DIPSETTING(    0x18, "D" )
  277.     PORT_DIPSETTING(    0x04, "E" )
  278.     PORT_DIPSETTING(    0x14, "F" )
  279.     PORT_DIPSETTING(    0x0c, "G" )
  280.     PORT_DIPSETTING(    0x1c, "H" )
  281.     PORT_DIPNAME( 0xe0, 0x40, "Practice Rank" )
  282.     PORT_DIPSETTING(    0x00, "A" )
  283.     PORT_DIPSETTING(    0x80, "B" )
  284.     PORT_DIPSETTING(    0x40, "C" )
  285.     PORT_DIPSETTING(    0xc0, "D" )
  286.     PORT_DIPSETTING(    0x20, "E" )
  287.     PORT_DIPSETTING(    0xa0, "F" )
  288.     PORT_DIPSETTING(    0x60, "G" )
  289.     PORT_DIPSETTING(    0xe0, "H" )
  290.  
  291.     PORT_START /* IN1 - Brake */
  292.     PORT_ANALOGX( 0xff, 0x00, IPT_PEDAL | IPF_PLAYER2, 100, 50, 0, 0xff, KEYCODE_LALT, IP_JOY_DEFAULT, IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  293.  
  294.     PORT_START /* IN2 - Accel */
  295.     PORT_ANALOGX( 0xff, 0x00, IPT_PEDAL, 100, 16, 0, 0x90, KEYCODE_LCONTROL, IP_JOY_DEFAULT, IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  296.  
  297.     PORT_START /* IN3 - Steering */
  298.     PORT_ANALOG ( 0xff, 0x80, IPT_DIAL, 60, 1, 0x00, 0xff )
  299. INPUT_PORTS_END
  300.  
  301.  
  302. INPUT_PORTS_START( polepos2 )
  303.     PORT_START  /* IN0 - Mostly Fake - Handled by the MCU */
  304.     PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNUSED )
  305.     PORT_BITX(0x02, IP_ACTIVE_HIGH, IPT_BUTTON1 | IPF_TOGGLE, "Gear Change", KEYCODE_SPACE, IP_JOY_DEFAULT ) /* Gear */
  306.     PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED )
  307.     PORT_DIPNAME( 0x08, 0x08, "Display Shift" )
  308.     PORT_DIPSETTING(    0x00, DEF_STR( Off ) )
  309.     PORT_DIPSETTING(    0x08, DEF_STR( On ) )
  310.     PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_COIN1 )
  311.     PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_COIN2 )
  312.     PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNUSED ) /* TEST button */
  313.     PORT_SERVICE( 0x80, IP_ACTIVE_HIGH )
  314.  
  315.     PORT_START  /* DSW0 */
  316.     PORT_DIPNAME( 0x01, 0x00, DEF_STR( Unknown ) )    /* docs say "freeze", but it doesn't seem to work */
  317.     PORT_DIPSETTING(    0x00, DEF_STR( Off ))
  318.     PORT_DIPSETTING(    0x01, DEF_STR( On ) )
  319.     PORT_DIPNAME( 0x02, 0x00, DEF_STR( Demo_Sounds ) )
  320.     PORT_DIPSETTING(    0x02, DEF_STR( Off ))
  321.     PORT_DIPSETTING(    0x00, DEF_STR( On ) )
  322.     PORT_DIPNAME( 0x04, 0x04, "Speed Unit" )
  323.     PORT_DIPSETTING(    0x04, "MPH" )
  324.     PORT_DIPSETTING(    0x00, "KPH" )
  325.     PORT_DIPNAME( 0x18, 0x00, DEF_STR( Coin_B ) )
  326.     PORT_DIPSETTING(    0x10, DEF_STR( 2C_1C ) )
  327.     PORT_DIPSETTING(    0x08, DEF_STR( 3C_2C ) )
  328.     PORT_DIPSETTING(    0x18, DEF_STR( 4C_3C ) )
  329.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  330.     PORT_DIPNAME( 0xe0, 0x00, DEF_STR( Coin_A ) )
  331.     PORT_DIPSETTING(    0x20, DEF_STR( 3C_1C ) )
  332.     PORT_DIPSETTING(    0xc0, DEF_STR( 2C_1C ) )
  333.     PORT_DIPSETTING(    0xa0, DEF_STR( 3C_2C ) )
  334.     PORT_DIPSETTING(    0x60, DEF_STR( 4C_3C ) )
  335.     PORT_DIPSETTING(    0x00, DEF_STR( 1C_1C ) )
  336.     PORT_DIPSETTING(    0x80, DEF_STR( 1C_2C ) )
  337.     PORT_DIPSETTING(    0x40, DEF_STR( 1C_3C ) )
  338.     PORT_DIPSETTING(    0xe0, DEF_STR( Free_Play ) )
  339.  
  340.     PORT_START  /* DSW1 */
  341.     PORT_DIPNAME( 0x01, 0x01, "Speed" )
  342.     PORT_DIPSETTING(    0x00, "Average" )
  343.     PORT_DIPSETTING(    0x01, "High" )
  344.     PORT_DIPNAME( 0x06, 0x00, "Goal" )
  345.     PORT_DIPSETTING(    0x04, "3" )
  346.     PORT_DIPSETTING(    0x00, "4" )
  347.     PORT_DIPSETTING(    0x02, "5" )
  348.     PORT_DIPSETTING(    0x06, "6" )
  349.     PORT_DIPNAME( 0x18, 0x08, "Extended Rank" )
  350.     PORT_DIPSETTING(    0x10, "A" )
  351.     PORT_DIPSETTING(    0x00, "B" )
  352.     PORT_DIPSETTING(    0x08, "C" )
  353.     PORT_DIPSETTING(    0x18, "D" )
  354.     PORT_DIPNAME( 0x60, 0x20, "Practice Rank" )
  355.     PORT_DIPSETTING(    0x40, "A" )
  356.     PORT_DIPSETTING(    0x00, "B" )
  357.     PORT_DIPSETTING(    0x20, "C" )
  358.     PORT_DIPSETTING(    0x60, "D" )
  359.     PORT_DIPNAME( 0x80, 0x80, "Game Time" )
  360.     PORT_DIPSETTING(    0x00, "90 secs." )
  361.     PORT_DIPSETTING(    0x80, "120 secs." )
  362.  
  363.     PORT_START /* IN1 - Brake */
  364.     PORT_ANALOGX( 0xff, 0x00, IPT_PEDAL | IPF_PLAYER2, 100, 50, 0, 0xff, KEYCODE_LALT, IP_JOY_DEFAULT, IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  365.  
  366.     PORT_START /* IN2 - Accel */
  367.     PORT_ANALOGX( 0xff, 0x00, IPT_PEDAL, 100, 16, 0, 0x90, KEYCODE_LCONTROL, IP_JOY_DEFAULT, IP_KEY_DEFAULT, IP_JOY_DEFAULT )
  368.  
  369.     PORT_START /* IN3 - Steering */
  370.     PORT_ANALOG ( 0xff, 0x80, IPT_DIAL, 60, 1, 0x00, 0xff )
  371. INPUT_PORTS_END
  372.  
  373.  
  374.  
  375. /*********************************************************************
  376.  * Graphics layouts
  377.  *********************************************************************/
  378.  
  379. static struct GfxLayout charlayout_2bpp =
  380. {
  381.     8,8,    /* 8*8 characters */
  382.     512,    /* 512 characters */
  383.     2,      /* 2 bits per pixel */
  384.     { 0, 4 }, /* the two bitplanes are packed */
  385.     { 0, 1, 2, 3, 8*8+0, 8*8+1, 8*8+2, 8*8+3 },
  386.     { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 },
  387.     8*8*2    /* every char takes 16 consecutive bytes */
  388. };
  389.  
  390. static struct GfxLayout bigspritelayout =
  391. {
  392.     32, 32, /* 32*32 sprites */
  393.     128,     /* 128 sprites */
  394.     4,        /* 4 bits per pixel */
  395.     { 0, 4, 0x8000*8+0, 0x8000*8+4 }, /* each two of the bitplanes are packed */
  396.     {  0,  1,  2,  3,  8,  9, 10, 11,
  397.       16, 17, 18, 19, 24, 25, 26, 27,
  398.       32, 33, 34, 35, 40, 41, 42, 43,
  399.       48, 49, 50, 51, 56, 57, 58, 59},
  400.     {  0*64,  1*64,  2*64,  3*64,  4*64,  5*64,  6*64,  7*64,
  401.         8*64,  9*64, 10*64, 11*64, 12*64, 13*64, 14*64, 15*64,
  402.       16*64, 17*64, 18*64, 19*64, 20*64, 21*64, 22*64, 23*64,
  403.       24*64, 25*64, 26*64, 27*64, 28*64, 29*64, 30*64, 31*64 },
  404.     32*32*2  /* each sprite takes 256 consecutive bytes */
  405. };
  406.  
  407. static struct GfxLayout smallspritelayout =
  408. {
  409.     16,32,  /* 16*32 sprites (pixel doubled vertically) */
  410.     128,    /* 128 sprites */
  411.     4,        /* 4 bits per pixel */
  412.     { 0, 4, 0x2000*8+0, 0x2000*8+4 }, /* each two of the bitplanes are packed */
  413.     {  0,  1,  2,  3,  8,  9, 10, 11,
  414.       16, 17, 18, 19, 24, 25, 26, 27 },
  415.     { 0*32,  0*32,  1*32,  1*32,  2*32,  2*32,  3*32,  3*32,
  416.       4*32,  4*32,  5*32,  5*32,  6*32,  6*32,  7*32,  7*32,
  417.       8*32,  8*32,  9*32,  9*32, 10*32, 10*32, 11*32, 11*32,
  418.      12*32, 12*32, 13*32, 13*32, 14*32, 14*32, 15*32, 15*32 },
  419.     16*16*2  /* each sprite takes 64 consecutive bytes */
  420. };
  421.  
  422. static struct GfxDecodeInfo gfxdecodeinfo[] =
  423. {
  424.     { REGION_GFX1, 0, &charlayout_2bpp,      0x0000, 128 },
  425.     { REGION_GFX2, 0, &charlayout_2bpp,      0x0200, 128 },
  426.     { REGION_GFX3, 0, &smallspritelayout, 0x0400, 128 },
  427.     { REGION_GFX4, 0, &bigspritelayout,      0x0400, 128 },
  428.     { -1 } /* end of array */
  429. };
  430.  
  431.  
  432. /*********************************************************************
  433.  * Sound interfaces
  434.  *********************************************************************/
  435.  
  436. static struct namco_interface namco_interface =
  437. {
  438.     3125000/64,        /* sample rate */
  439.     6,                /* number of voices */
  440.     95,                /* playback volume */
  441.     REGION_SOUND1,    /* memory region */
  442.     1                /* stereo */
  443. };
  444.  
  445. static struct CustomSound_interface custom_interface =
  446. {
  447.     polepos_sh_start,
  448.     polepos_sh_stop,
  449.     polepos_sh_update
  450. };
  451.  
  452. static const char *polepos_sample_names[] =
  453. {
  454.     "*polepos",
  455.     "pp2_17.wav",
  456.     "pp2_18.wav",
  457.     0    /* end of array */
  458. };
  459.  
  460. static struct Samplesinterface samples_interface =
  461. {
  462.     2,    /* 2 channels */
  463.     40,    /* volume */
  464.     polepos_sample_names
  465. };
  466.  
  467.  
  468.  
  469. /*********************************************************************
  470.  * Machine driver
  471.  *********************************************************************/
  472.  
  473. static struct MachineDriver machine_driver_polepos =
  474. {
  475.     /* basic machine hardware */
  476.     {
  477.         {
  478.             CPU_Z80,
  479.             3125000,    /* 3.125 Mhz */
  480.             z80_readmem,z80_writemem,z80_readport,z80_writeport,
  481.             ignore_interrupt,1
  482.         },
  483.         {
  484.             CPU_Z8000,
  485.             3125000,    /* 3.125 Mhz */
  486.             z8002_readmem,z8002_writemem,0,0,
  487.             polepos_z8002_1_interrupt,1
  488.         },
  489.         {
  490.             CPU_Z8000,
  491.             3125000,    /* 3.125 Mhz */
  492.             z8002_readmem,z8002_writemem,0,0,
  493.             polepos_z8002_2_interrupt,1
  494.         }
  495.     },
  496.     60, DEFAULT_REAL_60HZ_VBLANK_DURATION,     /* frames per second, vblank duration */
  497.     100,    /* some interleaving */
  498.     polepos_init_machine,
  499.  
  500.     /* video hardware */
  501.     32*8, 32*8, { 0*8, 32*8-1, 2*8, 30*8-1 },
  502.     gfxdecodeinfo,
  503.     128,0x1400,
  504.     polepos_vh_convert_color_prom,
  505.  
  506.     VIDEO_TYPE_RASTER,
  507.     0,
  508.     polepos_vh_start,
  509.     polepos_vh_stop,
  510.     polepos_vh_screenrefresh,
  511.  
  512.     /* sound hardware */
  513.     SOUND_SUPPORTS_STEREO, 0, 0, 0,
  514.     {
  515.         {
  516.             SOUND_NAMCO,
  517.             &namco_interface
  518.         },
  519.         {
  520.             SOUND_CUSTOM,
  521.             &custom_interface
  522.         },
  523.         {
  524.             SOUND_SAMPLES,
  525.             &samples_interface
  526.         }
  527.     },
  528.  
  529.     nvram_handler
  530. };
  531.  
  532.  
  533. /*********************************************************************
  534.  * ROM definitions
  535.  *********************************************************************/
  536.  
  537. ROM_START( polepos )
  538.     /* Z80 memory/ROM data */
  539.     ROM_REGION( 0x10000, REGION_CPU1 )
  540.     ROM_LOAD     ( "014-105.rom",    0x0000, 0x2000, 0xc918c043 )
  541.     ROM_LOAD     ( "014-116.rom",    0x2000, 0x1000, 0x7174bcb7 )
  542.  
  543.     /* Z8002 #1 memory/ROM data */
  544.     ROM_REGION( 0x10000, REGION_CPU2 )
  545.     ROM_LOAD_ODD ( "pp1_1b",        0x0000, 0x2000, 0x361c56dd )
  546.     ROM_LOAD_EVEN( "pp1_2b",        0x0000, 0x2000, 0x582b530a )
  547.  
  548.     /* Z8002 #2 memory/ROM data */
  549.     ROM_REGION( 0x10000, REGION_CPU3 )
  550.     ROM_LOAD_ODD ( "pp1_5b",        0x0000, 0x2000, 0x5cdf5294 )
  551.     ROM_LOAD_EVEN( "pp1_6b",        0x0000, 0x2000, 0x81696272 )
  552.  
  553.     /* graphics data */
  554.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  555.     ROM_LOAD     ( "pp1_28",        0x0000, 0x1000, 0x5b277daf )
  556.  
  557.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  558.     ROM_LOAD     ( "pp1_29",        0x0000, 0x1000, 0x706e888a )
  559.  
  560.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  561.     ROM_LOAD     ( "pp1_25",        0x0000, 0x2000, 0xac8e28c1 )    /* 4bpp sm sprites, planes 0+1 */
  562.     ROM_LOAD     ( "pp1_26",        0x2000, 0x2000, 0x94443079 )    /* 4bpp sm sprites, planes 2+3 */
  563.  
  564.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  565.     ROM_LOAD     ( "014-150.rom",    0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  566.     ROM_LOAD     ( "pp1_19",        0x2000, 0x2000, 0x43ff83e1 )
  567.     ROM_LOAD     ( "pp1_21",        0x4000, 0x2000, 0x5f958eb4 )
  568.     ROM_LOAD     ( "014-151.rom",    0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  569.     ROM_LOAD     ( "pp1_20",        0xa000, 0x2000, 0xec18075b )
  570.     ROM_LOAD     ( "pp1_22",        0xc000, 0x2000, 0x1d2f30b1 )
  571.  
  572.     /* graphics (P)ROM data */
  573.     ROM_REGION( 0x7000, REGION_PROMS )
  574.     ROM_LOAD     ( "014-137.bpr",    0x0000, 0x0100, 0xf07ff2ad )    /* red palette PROM */
  575.     ROM_LOAD     ( "014-138.bpr",    0x0100, 0x0100, 0xadbde7d7 )    /* green palette PROM */
  576.     ROM_LOAD     ( "014-139.bpr",    0x0200, 0x0100, 0xddac786a )    /* blue palette PROM */
  577.     ROM_LOAD     ( "014-140.bpr",    0x0300, 0x0100, 0x1e8d0491 )    /* alpha color PROM */
  578.     ROM_LOAD     ( "014-141.bpr",    0x0400, 0x0100, 0x0e4fe8a0 )    /* view color PROM */
  579.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  580.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  581.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  582.     ROM_LOAD     ( "014-145.bpr",    0x0800, 0x0400, 0x7afc7cfc )    /* road color PROM */
  583.     ROM_LOAD     ( "pp1_6.bpr",        0x0c00, 0x0400, 0x2f1079ee )    /* sprite color PROM */
  584.     ROM_LOAD     ( "131.11n",        0x1000, 0x1000, 0x5921777f )    /* vertical scaling PROM */
  585.     ROM_LOAD     ( "014-158.rom",    0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  586.     ROM_LOAD     ( "014-159.rom",    0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  587.     ROM_LOAD     ( "014-134.rom",    0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  588.  
  589.     /* sound (P)ROM data */
  590.     ROM_REGION( 0xd000, REGION_SOUND1 )
  591.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  592.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  593.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  594.     ROM_LOAD     ( "pp1_11",        0x5000, 0x2000, 0x45b9bfeb )    /* voice PROM */
  595.     ROM_LOAD     ( "pp1_12",        0x7000, 0x2000, 0xa31b4be5 )    /* voice PROM */
  596.     ROM_LOAD     ( "pp1_13",        0x9000, 0x2000, 0xa4237466 )    /* voice PROM */
  597.  
  598.     /* unknown or unused (P)ROM data */
  599.     ROM_REGION( 0x0100, REGION_USER1 )
  600.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  601. ROM_END
  602.  
  603.  
  604. ROM_START( poleposa )
  605.     /* Z80 memory/ROM data */
  606.     ROM_REGION( 0x10000, REGION_CPU1 )
  607.     ROM_LOAD     ( "014-105.rom",    0x0000, 0x2000, 0xc918c043 )
  608.     ROM_LOAD     ( "014-116.rom",    0x2000, 0x1000, 0x7174bcb7 )
  609.  
  610.     /* Z8002 #1 memory/ROM data */
  611.     ROM_REGION( 0x10000, REGION_CPU2 )
  612.     ROM_LOAD_ODD ( "014-101.rom",    0x0000, 0x2000, 0x8c2cf172 )
  613.     ROM_LOAD_EVEN( "014-102.rom",    0x0000, 0x2000, 0x51018857 )
  614.  
  615.     /* Z8002 #2 memory/ROM data */
  616.     ROM_REGION( 0x10000, REGION_CPU3 )
  617.     ROM_LOAD_ODD ( "014-203.rom",    0x0000, 0x2000, 0xeedea6e7 )
  618.     ROM_LOAD_EVEN( "014-204.rom",    0x0000, 0x2000, 0xc52c98ed )
  619.  
  620.     /* graphics data */
  621.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  622.     ROM_LOAD     ( "014-132.rom",    0x0000, 0x1000, 0xa949aa85 )
  623.  
  624.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )
  625.     ROM_LOAD     ( "014-133.rom",    0x0000, 0x1000, 0x3f0eb551 )    /* 2bpp view layer */
  626.  
  627.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  628.     ROM_LOAD     ( "014-156.rom",    0x0000, 0x2000, 0xe7a09c93 )    /* 4bpp sm sprites, planes 0+1 */
  629.     ROM_LOAD     ( "014-157.rom",    0x2000, 0x2000, 0xdee7d687 )    /* 4bpp sm sprites, planes 2+3 */
  630.  
  631.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  632.     ROM_LOAD     ( "014-150.rom",    0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  633.     ROM_LOAD     ( "014-152.rom",    0x2000, 0x2000, 0xa7e3a1c6 )
  634.     ROM_LOAD     ( "014-154.rom",    0x4000, 0x2000, 0x8992d381 )
  635.     ROM_LOAD     ( "014-151.rom",    0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  636.     ROM_LOAD     ( "014-153.rom",    0xa000, 0x2000, 0x6c5c6e68 )
  637.     ROM_LOAD     ( "014-155.rom",    0xc000, 0x2000, 0x111896ad )
  638.  
  639.     /* graphics (P)ROM data */
  640.     ROM_REGION( 0x7000, REGION_PROMS )
  641.     ROM_LOAD     ( "014-137.bpr",    0x0000, 0x0100, 0xf07ff2ad )    /* red palette PROM */
  642.     ROM_LOAD     ( "014-138.bpr",    0x0100, 0x0100, 0xadbde7d7 )    /* green palette PROM */
  643.     ROM_LOAD     ( "014-139.bpr",    0x0200, 0x0100, 0xddac786a )    /* blue palette PROM */
  644.     ROM_LOAD     ( "014-140.bpr",    0x0300, 0x0100, 0x1e8d0491 )    /* alpha color PROM */
  645.     ROM_LOAD     ( "014-141.bpr",    0x0400, 0x0100, 0x0e4fe8a0 )    /* view color PROM */
  646.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  647.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  648.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  649.     ROM_LOAD     ( "014-145.bpr",    0x0800, 0x0400, 0x7afc7cfc )    /* road color PROM */
  650.     ROM_LOAD     ( "014-146.bpr",    0x0c00, 0x0400, 0xca4ba741 )    /* sprite color PROM */
  651.     ROM_LOAD     ( "014-231.rom",    0x1000, 0x1000, 0xa61bff15 )    /* vertical scaling PROM */
  652.     ROM_LOAD     ( "014-158.rom",    0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  653.     ROM_LOAD     ( "014-159.rom",    0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  654.     ROM_LOAD     ( "014-134.rom",    0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  655.  
  656.     /* sound (P)ROM data */
  657.     ROM_REGION( 0xd000, REGION_SOUND1 )
  658.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  659.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  660.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  661.     ROM_LOAD     ( "014-106.rom",    0x5000, 0x2000, 0x5b4cf05e )    /* voice PROM */
  662.  
  663.     /* unknown or unused (P)ROM data */
  664.     ROM_REGION( 0x0100, REGION_USER1 )
  665.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  666. ROM_END
  667.  
  668.  
  669. ROM_START( polepos1 )
  670.     /* Z80 memory/ROM data */
  671.     ROM_REGION( 0x10000, REGION_CPU1 )
  672.     ROM_LOAD     ( "014-105.rom",    0x0000, 0x2000, 0xc918c043 )
  673.     ROM_LOAD     ( "014-116.rom",    0x2000, 0x1000, 0x7174bcb7 )
  674.  
  675.     /* Z8002 #1 memory/ROM data */
  676.     ROM_REGION( 0x10000, REGION_CPU2 )
  677.     ROM_LOAD_ODD ( "014-101.rom",    0x0000, 0x2000, 0x8c2cf172 )
  678.     ROM_LOAD_EVEN( "014-102.rom",    0x0000, 0x2000, 0x51018857 )
  679.  
  680.     /* Z8002 #2 memory/ROM data */
  681.     ROM_REGION( 0x10000, REGION_CPU3 )
  682.     ROM_LOAD_ODD ( "103.3e",        0x0000, 0x2000, 0xaf4fc019 )
  683.     ROM_LOAD_EVEN( "104.4e",        0x0000, 0x2000, 0xba0045f3 )
  684.  
  685.     /* graphics data */
  686.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  687.     ROM_LOAD     ( "014-132.rom",    0x0000, 0x1000, 0xa949aa85 )
  688.  
  689.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  690.     ROM_LOAD     ( "014-133.rom",    0x0000, 0x1000, 0x3f0eb551 )
  691.  
  692.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  693.     ROM_LOAD     ( "014-156.rom",    0x0000, 0x2000, 0xe7a09c93 )    /* 4bpp sm sprites, planes 0+1 */
  694.     ROM_LOAD     ( "014-157.rom",    0x2000, 0x2000, 0xdee7d687 )    /* 4bpp sm sprites, planes 2+3 */
  695.  
  696.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  697.     ROM_LOAD     ( "014-150.rom",    0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  698.     ROM_LOAD     ( "014-152.rom",    0x2000, 0x2000, 0xa7e3a1c6 )
  699.     ROM_LOAD     ( "014-154.rom",    0x4000, 0x2000, 0x8992d381 )
  700.     ROM_LOAD     ( "014-151.rom",    0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  701.     ROM_LOAD     ( "014-153.rom",    0xa000, 0x2000, 0x6c5c6e68 )
  702.     ROM_LOAD     ( "014-155.rom",    0xc000, 0x2000, 0x111896ad )
  703.  
  704.     /* graphics (P)ROM data */
  705.     ROM_REGION( 0x7000, REGION_PROMS )
  706.     ROM_LOAD     ( "014-137.bpr",    0x0000, 0x0100, 0xf07ff2ad )    /* red palette PROM */
  707.     ROM_LOAD     ( "014-138.bpr",    0x0100, 0x0100, 0xadbde7d7 )    /* green palette PROM */
  708.     ROM_LOAD     ( "014-139.bpr",    0x0200, 0x0100, 0xddac786a )    /* blue palette PROM */
  709.     ROM_LOAD     ( "014-140.bpr",    0x0300, 0x0100, 0x1e8d0491 )    /* alpha color PROM */
  710.     ROM_LOAD     ( "014-141.bpr",    0x0400, 0x0100, 0x0e4fe8a0 )    /* view color PROM */
  711.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  712.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  713.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  714.     ROM_LOAD     ( "014-145.bpr",    0x0800, 0x0400, 0x7afc7cfc )    /* road color PROM */
  715.     ROM_LOAD     ( "014-146.bpr",    0x0c00, 0x0400, 0xca4ba741 )    /* sprite color PROM */
  716.     ROM_LOAD     ( "131.11n",        0x1000, 0x1000, 0x5921777f )    /* vertical scaling PROM */
  717.     ROM_LOAD     ( "014-158.rom",    0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  718.     ROM_LOAD     ( "014-159.rom",    0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  719.     ROM_LOAD     ( "014-134.rom",    0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  720.  
  721.     /* sound (P)ROM data */
  722.     ROM_REGION( 0xd000, REGION_SOUND1 )
  723.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  724.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  725.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  726.     ROM_LOAD     ( "014-106.rom",    0x5000, 0x2000, 0x5b4cf05e )    /* voice PROM */
  727.  
  728.     /* unknown or unused (P)ROM data */
  729.     ROM_REGION( 0x0100, REGION_USER1 )
  730.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  731. ROM_END
  732.  
  733.  
  734. ROM_START( topracer )
  735.     /* Z80 memory/ROM data */
  736.     ROM_REGION( 0x10000, REGION_CPU1 )
  737.     ROM_LOAD     ( "tr9b.bin",        0x0000, 0x2000, 0x94436b70 )
  738.     ROM_LOAD     ( "014-116.rom",    0x2000, 0x1000, 0x7174bcb7 )
  739.  
  740.     /* Z8002 #1 memory/ROM data */
  741.     ROM_REGION( 0x10000, REGION_CPU2 )
  742.     ROM_LOAD_ODD ( "tr1b.bin",        0x0000, 0x2000, 0x127f0750 )
  743.     ROM_LOAD_EVEN( "tr2b.bin",        0x0000, 0x2000, 0x6bd4ff6b )
  744.  
  745.     /* Z8002 #2 memory/ROM data */
  746.     ROM_REGION( 0x10000, REGION_CPU3 )
  747.     ROM_LOAD_ODD ( "tr5b.bin",        0x0000, 0x2000, 0x4e5f7b9c )
  748.     ROM_LOAD_EVEN( "tr6b.bin",        0x0000, 0x2000, 0x9d038ada )
  749.  
  750.     /* graphics data */
  751.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  752.     ROM_LOAD     ( "tr28.bin",        0x0000, 0x1000, 0xb8217c96 )
  753.  
  754.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  755.     ROM_LOAD     ( "tr29.bin",        0x0000, 0x1000, 0xc6e15c21 )
  756.  
  757.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  758.     ROM_LOAD     ( "trus25.bin",    0x0000, 0x2000, 0x9e1a9c3b )    /* 4bpp sm sprites, planes 0+1 */
  759.     ROM_LOAD     ( "trus26.bin",    0x2000, 0x2000, 0x3b39a176 )    /* 4bpp sm sprites, planes 2+3 */
  760.  
  761.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  762.     ROM_LOAD     ( "pp17.bin",        0x0000, 0x2000, 0x613ab0df )    /* 4bpp lg sprites, planes 0+1 */
  763.     ROM_LOAD     ( "tr19.bin",        0x2000, 0x2000, 0xf8e7f551 )
  764.     ROM_LOAD     ( "tr21.bin",        0x4000, 0x2000, 0x17c798b0 )
  765.     ROM_LOAD     ( "pp18.bin",        0x8000, 0x2000, 0x5fd933e3 )    /* 4bpp lg sprites, planes 2+3 */
  766.     ROM_LOAD     ( "tr20.bin",        0xa000, 0x2000, 0x7053e219 )
  767.     ROM_LOAD     ( "tr22.bin",        0xc000, 0x2000, 0xf48917b2 )
  768.  
  769.     /* graphics (P)ROM data */
  770.     ROM_REGION( 0x7000, REGION_PROMS )
  771.     ROM_LOAD     ( "014-137.bpr",    0x0000, 0x0100, 0xf07ff2ad )    /* red palette PROM */
  772.     ROM_LOAD     ( "014-138.bpr",    0x0100, 0x0100, 0xadbde7d7 )    /* green palette PROM */
  773.     ROM_LOAD     ( "014-139.bpr",    0x0200, 0x0100, 0xddac786a )    /* blue palette PROM */
  774.     ROM_LOAD     ( "10p.bin",        0x0300, 0x0100, 0x5af3f710 )    /* alpha color PROM */
  775.     ROM_LOAD     ( "014-141.bpr",    0x0400, 0x0100, 0x00000000 )    /* view color PROM */
  776.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  777.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  778.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  779.     ROM_LOAD     ( "014-145.bpr",    0x0800, 0x0400, 0x7afc7cfc )    /* road color PROM */
  780.     ROM_LOAD     ( "pp1_6.bpr",        0x0c00, 0x0400, 0x2f1079ee )    /* sprite color PROM */
  781.     ROM_LOAD     ( "014-231.rom",    0x1000, 0x1000, 0xa61bff15 )    /* vertical scaling PROM */
  782.     ROM_LOAD     ( "014-158.rom",    0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  783.     ROM_LOAD     ( "014-159.rom",    0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  784.     ROM_LOAD     ( "014-134.rom",    0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  785.  
  786.     /* sound (P)ROM data */
  787.     ROM_REGION( 0xd000, REGION_SOUND1 )
  788.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  789.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  790.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  791.     ROM_LOAD     ( "014-106.rom",    0x5000, 0x2000, 0x5b4cf05e )    /* voice PROM */
  792.  
  793.     /* unknown or unused (P)ROM data */
  794.     ROM_REGION( 0x0100, REGION_USER1 )
  795.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  796. ROM_END
  797.  
  798.  
  799. ROM_START( polepos2 )
  800.     /* Z80 memory/ROM data */
  801.     ROM_REGION( 0x10000, REGION_CPU1 )
  802.     ROM_LOAD     ( "pp4_9.6h",        0x0000, 0x2000, 0xbcf87004 )
  803.     ROM_LOAD     ( "183.7f",        0x2000, 0x1000, 0xa9d4c380 )
  804.  
  805.     /* Z8002 #1 memory/ROM data */
  806.     ROM_REGION( 0x10000, REGION_CPU2 )
  807.     ROM_LOAD_ODD ( "pp4_1.8m",        0x0000, 0x2000, 0x3f6ac294 )
  808.     ROM_LOAD_EVEN( "pp4_2.8l",        0x0000, 0x2000, 0x51b9a669 )
  809.  
  810.     /* Z8002 #2 memory/ROM data */
  811.     ROM_REGION( 0x10000, REGION_CPU3 )
  812.     ROM_LOAD_ODD ( "pp4_5.4m",        0x0000, 0x2000, 0xc3053cae )
  813.     ROM_LOAD_EVEN( "pp4_6.4l",        0x0000, 0x2000, 0x38d04e0f )
  814.     ROM_LOAD_ODD ( "pp4_7.3m",        0x4000, 0x1000, 0xad1c8994 )
  815.     ROM_LOAD_EVEN( "pp4_8.3l",        0x4000, 0x1000, 0xef25a2ee )
  816.  
  817.     /* graphics data */
  818.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  819.     ROM_LOAD     ( "pp4_28.1f",        0x0000, 0x2000, 0x280dde7d )
  820.  
  821.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  822.     ROM_LOAD     ( "173.6n",        0x0000, 0x2000, 0xec3ec6e6 )
  823.  
  824.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  825.     ROM_LOAD     ( "pp4_25.1n",        0x0000, 0x2000, 0xfd098e65 )    /* 4bpp sm sprites, planes 0+1 */
  826.     ROM_LOAD     ( "pp4_26.1m",        0x2000, 0x2000, 0x35ac62b3 )    /* 4bpp sm sprites, planes 2+3 */
  827.  
  828.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  829.     ROM_LOAD     ( "119.13j",        0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  830.     ROM_LOAD     ( "pp1_19.4n",        0x2000, 0x2000, 0x43ff83e1 )
  831.     ROM_LOAD     ( "pp1_21.3n",        0x4000, 0x2000, 0x5f958eb4 )
  832.     ROM_LOAD     ( "pp4_23.2n",        0x6000, 0x2000, 0x9e056fcd )
  833.     ROM_LOAD     ( "120.12j",        0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  834.     ROM_LOAD     ( "pp1_20.4m",        0xa000, 0x2000, 0xec18075b )
  835.     ROM_LOAD     ( "pp1_22.3m",        0xc000, 0x2000, 0x1d2f30b1 )
  836.     ROM_LOAD     ( "pp4_24.2m",        0xe000, 0x2000, 0x795268cf )
  837.  
  838.     /* graphics (P)ROM data */
  839.     ROM_REGION( 0x7000, REGION_PROMS )
  840.     ROM_LOAD     ( "014-186.bpr",    0x0000, 0x0100, 0x16d69c31 )    /* red palette PROM */
  841.     ROM_LOAD     ( "014-187.bpr",    0x0100, 0x0100, 0x07340311 )    /* green palette PROM */
  842.     ROM_LOAD     ( "014-188.bpr",    0x0200, 0x0100, 0x1efc84d7 )    /* blue palette PROM */
  843.     ROM_LOAD     ( "014-189.bpr",    0x0300, 0x0100, 0x064d51a0 )    /* alpha color PROM */
  844.     ROM_LOAD     ( "014-190.bpr",    0x0400, 0x0100, 0x7880c5af )    /* view color PROM */
  845.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  846.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  847.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  848.     ROM_LOAD     ( "014-191.bpr",    0x0800, 0x0400, 0x8b270902 )    /* road color PROM */
  849.     ROM_LOAD     ( "pp4-6.6m",        0x0c00, 0x0400, 0x647212b5 )    /* sprite color PROM */
  850.     ROM_LOAD     ( "131.11n",        0x1000, 0x1000, 0x5921777f )    /* vertical scaling PROM */
  851.     ROM_LOAD     ( "127.2l",        0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  852.     ROM_LOAD     ( "128.2m",        0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  853.     ROM_LOAD     ( "134.2n",        0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  854.  
  855.     /* sound (P)ROM data */
  856.     ROM_REGION( 0xd000, REGION_SOUND1 )
  857.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  858.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  859.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  860.     ROM_LOAD     ( "pp1_11.2e",        0x5000, 0x2000, 0x45b9bfeb )    /* voice PROM */
  861.     ROM_LOAD     ( "pp1_12.2f",        0x7000, 0x2000, 0xa31b4be5 )    /* voice PROM */
  862.     ROM_LOAD     ( "pp1_13.1e",        0x9000, 0x2000, 0xa4237466 )    /* voice PROM */
  863.     ROM_LOAD     ( "pp1_14.1f",        0xb000, 0x2000, 0x944580f9 )    /* voice PROM */
  864.  
  865.     /* unknown or unused (P)ROM data */
  866.     ROM_REGION( 0x0100, REGION_USER1 )
  867.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  868. ROM_END
  869.  
  870.  
  871. ROM_START( poleps2a )
  872.     /* Z80 memory/ROM data */
  873.     ROM_REGION( 0x10000, REGION_CPU1 )
  874.     ROM_LOAD     ( "180.7h",        0x0000, 0x2000, 0xf85212c4 )
  875.     ROM_LOAD     ( "183.7f",        0x2000, 0x1000, 0xa9d4c380 )
  876.  
  877.     /* Z8002 #1 memory/ROM data */
  878.     ROM_REGION( 0x10000, REGION_CPU2 )
  879.     ROM_LOAD_ODD ( "176.3l",        0x0000, 0x2000, 0x8aeaec98 )
  880.     ROM_LOAD_EVEN( "177.4l",        0x0000, 0x2000, 0x7051df35 )
  881.  
  882.     /* Z8002 #2 memory/ROM data */
  883.     ROM_REGION( 0x10000, REGION_CPU3 )
  884.     ROM_LOAD_ODD ( "178.3e",        0x0000, 0x2000, 0xeac35cfa )
  885.     ROM_LOAD_EVEN( "179.4e",        0x0000, 0x2000, 0x613e917d )
  886.     ROM_LOAD_ODD ( "184.3d",        0x4000, 0x2000, 0xd893c4ed )
  887.     ROM_LOAD_EVEN( "185.4d",        0x4000, 0x2000, 0x899de75e )
  888.  
  889.     /* graphics data */
  890.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  891.     ROM_LOAD     ( "172.7n",        0x0000, 0x2000, 0xfbe5e72f )
  892.  
  893.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  894.     ROM_LOAD     ( "173.6n",        0x0000, 0x2000, 0xec3ec6e6 )
  895.  
  896.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  897.     ROM_LOAD     ( "170.13n",        0x0000, 0x2000, 0x455d79a0 )    /* 4bpp sm sprites, planes 0+1 */
  898.     ROM_LOAD     ( "171.12n",        0x2000, 0x2000, 0x78372b81 )    /* 4bpp sm sprites, planes 2+3 */
  899.  
  900.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  901.     ROM_LOAD     ( "119.13j",        0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  902.     ROM_LOAD     ( "166.13k",        0x2000, 0x2000, 0x2b0517bd )
  903.     ROM_LOAD     ( "168.13l",        0x4000, 0x2000, 0x4d7916d9 )
  904.     ROM_LOAD     ( "175.13m",        0x6000, 0x2000, 0xbd6df480 )
  905.     ROM_LOAD     ( "120.12j",        0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  906.     ROM_LOAD     ( "167.12k",        0xa000, 0x2000, 0x411e21b5 )
  907.     ROM_LOAD     ( "169.12l",        0xc000, 0x2000, 0x662ff24b )
  908.     ROM_LOAD     ( "174.12m",        0xe000, 0x2000, 0xf0c571dc )
  909.  
  910.     /* graphics (P)ROM data */
  911.     ROM_REGION( 0x7000, REGION_PROMS )
  912.     ROM_LOAD     ( "014-186.bpr",    0x0000, 0x0100, 0x16d69c31 )    /* red palette PROM */
  913.     ROM_LOAD     ( "014-187.bpr",    0x0100, 0x0100, 0x07340311 )    /* green palette PROM */
  914.     ROM_LOAD     ( "014-188.bpr",    0x0200, 0x0100, 0x1efc84d7 )    /* blue palette PROM */
  915.     ROM_LOAD     ( "014-189.bpr",    0x0300, 0x0100, 0x064d51a0 )    /* alpha color PROM */
  916.     ROM_LOAD     ( "014-190.bpr",    0x0400, 0x0100, 0x7880c5af )    /* view color PROM */
  917.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  918.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  919.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  920.     ROM_LOAD     ( "014-191.bpr",    0x0800, 0x0400, 0x8b270902 )    /* road color PROM */
  921.     ROM_LOAD     ( "014-192.bpr",    0x0c00, 0x0400, 0xcaddb0b0 )    /* sprite color PROM */
  922.     ROM_LOAD     ( "131.11n",        0x1000, 0x1000, 0x5921777f )    /* vertical scaling PROM */
  923.     ROM_LOAD     ( "127.2l",        0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  924.     ROM_LOAD     ( "128.2m",        0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  925.     ROM_LOAD     ( "134.2n",        0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  926.  
  927.     /* sound (P)ROM data */
  928.     ROM_REGION( 0xd000, REGION_SOUND1 )
  929.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  930.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  931.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  932.     ROM_LOAD     ( "014-106.rom",    0x5000, 0x2000, 0x5b4cf05e )    /* voice PROM */
  933.  
  934.     /* unknown or unused (P)ROM data */
  935.     ROM_REGION( 0x0100, REGION_USER1 )
  936.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  937. ROM_END
  938.  
  939.  
  940. ROM_START( poleps2b )
  941.     /* Z80 memory/ROM data */
  942.     ROM_REGION( 0x10000, REGION_CPU1 )
  943.     ROM_LOAD     ( "180.7h",        0x0000, 0x2000, 0xf85212c4 )
  944.     ROM_LOAD     ( "183.7f",        0x2000, 0x1000, 0xa9d4c380 )
  945.  
  946.     /* Z8002 #1 memory/ROM data */
  947.     ROM_REGION( 0x10000, REGION_CPU2 )
  948.     ROM_LOAD_ODD ( "176-v2.3l",        0x0000, 0x2000, 0x848ab742 )
  949.     ROM_LOAD_EVEN( "177-v2.4l",        0x0000, 0x2000, 0x643483f7 )
  950.     ROM_LOAD_EVEN( "rom-v2.4k",        0x4000, 0x1000, 0x2d70dce4 )
  951.  
  952.     /* Z8002 #2 memory/ROM data */
  953.     ROM_REGION( 0x10000, REGION_CPU3 )
  954.     ROM_LOAD_ODD ( "178.3e",        0x0000, 0x2000, 0xeac35cfa )
  955.     ROM_LOAD_EVEN( "179.4e",        0x0000, 0x2000, 0x613e917d )
  956.     ROM_LOAD_ODD ( "184.3d",        0x4000, 0x2000, 0xd893c4ed )
  957.     ROM_LOAD_EVEN( "185.4d",        0x4000, 0x2000, 0x899de75e )
  958.  
  959.     /* graphics data */
  960.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  961.     ROM_LOAD     ( "172.7n",        0x0000, 0x2000, 0xfbe5e72f )
  962.  
  963.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  964.     ROM_LOAD     ( "173.6n",        0x0000, 0x2000, 0xec3ec6e6 )
  965.  
  966.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  967.     ROM_LOAD     ( "170.13n",        0x0000, 0x2000, 0x455d79a0 )    /* 4bpp sm sprites, planes 0+1 */
  968.     ROM_LOAD     ( "171.12n",        0x2000, 0x2000, 0x78372b81 )    /* 4bpp sm sprites, planes 2+3 */
  969.  
  970.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  971.     ROM_LOAD     ( "119.13j",        0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  972.     ROM_LOAD     ( "166.13k",        0x2000, 0x2000, 0x2b0517bd )
  973.     ROM_LOAD     ( "168.13l",        0x4000, 0x2000, 0x4d7916d9 )
  974.     ROM_LOAD     ( "175.13m",        0x6000, 0x2000, 0xbd6df480 )
  975.     ROM_LOAD     ( "120.12j",        0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  976.     ROM_LOAD     ( "167.12k",        0xa000, 0x2000, 0x411e21b5 )
  977.     ROM_LOAD     ( "169.12l",        0xc000, 0x2000, 0x662ff24b )
  978.     ROM_LOAD     ( "174.12m",        0xe000, 0x2000, 0xf0c571dc )
  979.  
  980.     /* graphics (P)ROM data */
  981.     ROM_REGION( 0x7000, REGION_PROMS )
  982.     ROM_LOAD     ( "014-186.bpr",    0x0000, 0x0100, 0x16d69c31 )    /* red palette PROM */
  983.     ROM_LOAD     ( "014-187.bpr",    0x0100, 0x0100, 0x07340311 )    /* green palette PROM */
  984.     ROM_LOAD     ( "014-188.bpr",    0x0200, 0x0100, 0x1efc84d7 )    /* blue palette PROM */
  985.     ROM_LOAD     ( "014-189.bpr",    0x0300, 0x0100, 0x064d51a0 )    /* alpha color PROM */
  986.     ROM_LOAD     ( "014-190.bpr",    0x0400, 0x0100, 0x7880c5af )    /* view color PROM */
  987.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  988.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  989.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  990.     ROM_LOAD     ( "014-191.bpr",    0x0800, 0x0400, 0x8b270902 )    /* road color PROM */
  991.     ROM_LOAD     ( "014-192.bpr",    0x0c00, 0x0400, 0xcaddb0b0 )    /* sprite color PROM */
  992.     ROM_LOAD     ( "131.11n",        0x1000, 0x1000, 0x5921777f )    /* vertical scaling PROM */
  993.     ROM_LOAD     ( "127.2l",        0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  994.     ROM_LOAD     ( "128.2m",        0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  995.     ROM_LOAD     ( "134.2n",        0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  996.  
  997.     /* sound (P)ROM data */
  998.     ROM_REGION( 0xd000, REGION_SOUND1 )
  999.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  1000.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  1001.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  1002.     ROM_LOAD     ( "014-106.rom",    0x5000, 0x2000, 0x5b4cf05e )    /* voice PROM */
  1003.  
  1004.     /* unknown or unused (P)ROM data */
  1005.     ROM_REGION( 0x0100, REGION_USER1 )
  1006.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  1007. ROM_END
  1008.  
  1009.  
  1010. ROM_START( poleps2c )
  1011.     /* Z80 memory/ROM data */
  1012.     ROM_REGION( 0x10000, REGION_CPU1 )
  1013.     ROM_LOAD     ( "180.7h",        0x0000, 0x2000, 0xf85212c4 )
  1014.     ROM_LOAD     ( "183.7f",        0x2000, 0x1000, 0xa9d4c380 )
  1015.  
  1016.     /* Z8002 #1 memory/ROM data */
  1017.     ROM_REGION( 0x10000, REGION_CPU2 )
  1018.     ROM_LOAD_ODD ( "3lcpu.rom",        0x0000, 0x2000, 0xcf95a6b7 )
  1019.     ROM_LOAD_EVEN( "177-v2.4l",        0x0000, 0x2000, 0x643483f7 )
  1020.     ROM_LOAD_EVEN( "cpu-4k.rom",    0x4000, 0x1000, 0x97a496b3 )
  1021.  
  1022.     /* Z8002 #2 memory/ROM data */
  1023.     ROM_REGION( 0x10000, REGION_CPU3 )
  1024.     ROM_LOAD_ODD ( "178.3e",        0x0000, 0x2000, 0xeac35cfa )
  1025.     ROM_LOAD_EVEN( "179.4e",        0x0000, 0x2000, 0x613e917d )
  1026.     ROM_LOAD_ODD ( "184.3d",        0x4000, 0x2000, 0xd893c4ed )
  1027.     ROM_LOAD_EVEN( "185.4d",        0x4000, 0x2000, 0x899de75e )
  1028.  
  1029.     /* graphics data */
  1030.     ROM_REGION( 0x02000, REGION_GFX1 | REGIONFLAG_DISPOSE )        /* 2bpp alpha layer */
  1031.     ROM_LOAD     ( "172.7n",        0x0000, 0x2000, 0xfbe5e72f )
  1032.  
  1033.     ROM_REGION( 0x02000, REGION_GFX2 | REGIONFLAG_DISPOSE )        /* 2bpp view layer */
  1034.     ROM_LOAD     ( "173.6n",        0x0000, 0x2000, 0xec3ec6e6 )
  1035.  
  1036.     ROM_REGION( 0x04000, REGION_GFX3 | REGIONFLAG_DISPOSE )        /* 4bpp 16x16 sprites */
  1037.     ROM_LOAD     ( "170.13n",        0x0000, 0x2000, 0x455d79a0 )    /* 4bpp sm sprites, planes 0+1 */
  1038.     ROM_LOAD     ( "171.12n",        0x2000, 0x2000, 0x78372b81 )    /* 4bpp sm sprites, planes 2+3 */
  1039.  
  1040.     ROM_REGION( 0x10000, REGION_GFX4 | REGIONFLAG_DISPOSE )        /* 4bpp 32x32 sprites */
  1041.     ROM_LOAD     ( "119.13j",        0x0000, 0x2000, 0x2e134b46 )    /* 4bpp lg sprites, planes 0+1 */
  1042.     ROM_LOAD     ( "166.13k",        0x2000, 0x2000, 0x2b0517bd )
  1043.     ROM_LOAD     ( "13lvid.rom",    0x4000, 0x2000, 0x9ab89d7f )
  1044.     ROM_LOAD     ( "175.13m",        0x6000, 0x2000, 0xbd6df480 )
  1045.     ROM_LOAD     ( "120.12j",        0x8000, 0x2000, 0x6f9997d2 )    /* 4bpp lg sprites, planes 2+3 */
  1046.     ROM_LOAD     ( "12kvid.rom",    0xa000, 0x2000, 0xfa131a9b )
  1047.     ROM_LOAD     ( "169.12l",        0xc000, 0x2000, 0x662ff24b )
  1048.     ROM_LOAD     ( "174.12m",        0xe000, 0x2000, 0xf0c571dc )
  1049.  
  1050.     /* graphics (P)ROM data */
  1051.     ROM_REGION( 0x7000, REGION_PROMS )
  1052.     ROM_LOAD     ( "014-186.bpr",    0x0000, 0x0100, 0x16d69c31 )    /* red palette PROM */
  1053.     ROM_LOAD     ( "014-187.bpr",    0x0100, 0x0100, 0x07340311 )    /* green palette PROM */
  1054.     ROM_LOAD     ( "014-188.bpr",    0x0200, 0x0100, 0x1efc84d7 )    /* blue palette PROM */
  1055.     ROM_LOAD     ( "014-189.bpr",    0x0300, 0x0100, 0x064d51a0 )    /* alpha color PROM */
  1056.     ROM_LOAD     ( "014-190.bpr",    0x0400, 0x0100, 0x7880c5af )    /* view color PROM */
  1057.     ROM_LOAD     ( "014-142.bpr",    0x0500, 0x0100, 0x2d502464 )    /* vertical position low PROM */
  1058.     ROM_LOAD     ( "014-143.bpr",    0x0600, 0x0100, 0x027aa62c )    /* vertical position med PROM */
  1059.     ROM_LOAD     ( "014-144.bpr",    0x0700, 0x0100, 0x1f8d0df3 )    /* vertical position hi PROM */
  1060.     ROM_LOAD     ( "014-191.bpr",    0x0800, 0x0400, 0x8b270902 )    /* road color PROM */
  1061.     ROM_LOAD     ( "014-192.bpr",    0x0c00, 0x0400, 0xcaddb0b0 )    /* sprite color PROM */
  1062.     ROM_LOAD     ( "131.11n",        0x1000, 0x1000, 0x5921777f )    /* vertical scaling PROM */
  1063.     ROM_LOAD     ( "127.2l",        0x2000, 0x2000, 0xee6b3315 )    /* road control PROM */
  1064.     ROM_LOAD     ( "128.2m",        0x4000, 0x2000, 0x6d1e7042 )    /* road bits 1 PROM */
  1065.     ROM_LOAD     ( "134.2n",        0x6000, 0x1000, 0x4e97f101 )    /* read bits 2 PROM */
  1066.  
  1067.     /* sound (P)ROM data */
  1068.     ROM_REGION( 0xd000, REGION_SOUND1 )
  1069.     ROM_LOAD     ( "014-118.bpr",    0x0000, 0x0100, 0x8568decc )    /* Namco sound PROM */
  1070.     ROM_LOAD     ( "014-110.rom",    0x1000, 0x2000, 0xb5ad4d5f )    /* engine sound PROM */
  1071.     ROM_LOAD     ( "014-111.rom",    0x3000, 0x2000, 0x8fdd2f6f )    /* engine sound PROM */
  1072.     ROM_LOAD     ( "014-106.rom",    0x5000, 0x2000, 0x5b4cf05e )    /* voice PROM */
  1073.  
  1074.     /* unknown or unused (P)ROM data */
  1075.     ROM_REGION( 0x0100, REGION_USER1 )
  1076.     ROM_LOAD     ( "014-117.bpr",    0x0000, 0x0100, 0x2401c817 )    /* sync chain */
  1077. ROM_END
  1078.  
  1079.  
  1080. /*********************************************************************
  1081.  * Initialization routines
  1082.  *********************************************************************/
  1083.  
  1084. static void init_polepos2(void)
  1085. {
  1086.     /* note that the bootleg versions don't need this custom IC; they have a hacked ROM in its place */
  1087.     install_mem_read_handler(1, 0x4000, 0x5fff, polepos2_ic25_r);
  1088. }
  1089.  
  1090.  
  1091. /*********************************************************************
  1092.  * Game drivers
  1093.  *********************************************************************/
  1094.  
  1095. GAME( 1982, polepos,  0,        polepos, polepos,  0,        ROT0, "Namco", "Pole Position" )
  1096. GAME( 1982, poleposa, polepos,  polepos, polepos,  0,        ROT0, "Namco (Atari license)", "Pole Position (Atari version 2)" )
  1097. GAME( 1982, polepos1, polepos,  polepos, polepos,  0,        ROT0, "[Namco] (Atari license)", "Pole Position (Atari version 1)" )
  1098. GAME( 1982, topracer, polepos,  polepos, polepos,  0,        ROT0, "bootleg", "Top Racer" )
  1099. GAME( 1983, polepos2, 0,        polepos, polepos2, polepos2, ROT0, "Namco", "Pole Position II" )
  1100. GAME( 1983, poleps2a, polepos2, polepos, polepos2, polepos2, ROT0, "Namco (Atari license)", "Pole Position II (Atari)" )
  1101. GAME( 1983, poleps2b, polepos2, polepos, polepos2, 0,        ROT0, "Namco (Atari license)", "Pole Position II (Atari bootleg 1)" )
  1102. GAME( 1983, poleps2c, polepos2, polepos, polepos2, 0,        ROT0, "Namco (Atari license)", "Pole Position II (Atari bootleg 2)" )
  1103.